﻿using System;
using NRehersal;

namespace NHerhersal.Tests
{
    public class NRehersalTestSimple : RehersalBase
    {
        public override void TheTests()
        {
            onceBeforeEachTest=delegate 
                {
                    Console.WriteLine("before each TEST");
                };

            onceBeforeAllTests=delegate
                {
                    Console.WriteLine("before all tests");
                };

            
            TEST("This is a TEST", delegate
            {
                Console.WriteLine("in TEST");
            });

            TEST("This is a TEST with an expected exception")
                .ExpectException<OutOfMemoryException>()
                .Execute(delegate
                             {
                                 throw new OutOfMemoryException("whatever");
                             });
        }
    }

}
